<template>
  <div>

    <el-row :gutter="5">
      <el-col :span="2">
        <el-input v-model="customer" placeholder="客户"></el-input>
      </el-col>
      <el-col :span="2">
        <template>
          <el-select v-model="value" placeholder="请选择">
            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </template>
      </el-col>
      <el-col :span="2">
        <el-button type="success"  @click="init">搜索</el-button>
      </el-col>
    </el-row>
    <br>
    
    <!-- 表格开始 -->
    <el-table ref="list" :data="tableData" style="width: 100%" border stripe highlight-current-row
      :default-sort="{prop: 'date', order: 'descending'}"
      @select-all="handleCheckedAllAndCheckedNone"
      @select="handleCheckedAllAndCheckedNone"
      @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="45" align="center">
      </el-table-column>
      <el-table-column property="id" label="编号">
      </el-table-column>
      <el-table-column property="customer" label="客户名">
      </el-table-column>
      <el-table-column property="dicValue" label="服务类型">
      </el-table-column>
      <el-table-column property="overview" label="概要信息">
      </el-table-column>
      <el-table-column property="createPeople" label="创建人">
      </el-table-column>
      <el-table-column property="assignTime" label="分配时间">
      </el-table-column>
      <el-table-column property="assigner" label="分配人">
      </el-table-column>
      <el-table-column property="serviceProcePeople" label="处理人">
      </el-table-column>
      <el-table-column property="serviceProceResult" label="处理内容">
      </el-table-column>
      <el-table-column property="serviceProceTime" label="处理时间">
      </el-table-column>
      <el-table-column property="serviceProceResult" label="处理结果">
      </el-table-column>
      <el-table-column property="myd" label="满意度">
      </el-table-column>
      <el-table-column property="createDate" label="创建时间">
      </el-table-column>
      <el-table-column property="updateDate" label="更新时间">
      </el-table-column>
    </el-table>

  </div>
</template>

<script>
  import axios from 'axios'
  export default {
    name: "Table",
    data() {
      return {
        options: [{
          value: '6',
          label: '咨询'
        }, {
          value: '8',
          label: '投诉'
        }, {
          value: '7',
          label: '建议'
        }],
        value: '',

        //弹出层数据
        formFileds: {},
        tableData: [],
        page: { //分页参数
          pageNo: 1,
          pageSize: 10,
          totalCount: 0
        },
        customer: '',
        roleList:[],
        assignTime: '',
        assigner: '',
        isShowEditDialog: false,
        multipleSelection: [],
        userId: [],

      }
    },
    methods: {
      //初始化表格
      init() {
        axios.get("http://localhost:8081/customerServe/list", {
            params: {
              serveType: this.value,
              customer: this.customer,
              pageNo: this.page.pageNo,
              pageSize: this.page.pageSize
            }
          })
          .then(res => {
            if (res.data.code == 2000) {
              console.log("===========" + res.data.data)
              this.page.totalCount = res.data.data.total
              this.tableData = res.data.data.records
            }
          })
      },

      initTableData() {
        var name = localStorage.getItem("username")
       this.assignTime =name
        console.log(this.assignTime)
        axios.get("http://localhost:8081/customerServe/chuli?username="+this.assignTime)
          .then(res => {
            if (res.data.code == 2000) {
              console.log("xaaaaaaaaaaaaaaaaaaa"+ res.data.data)
              this.tableData = res.data.data
            }
          })
      },

 

    },
    mounted() {
      this.initTableData()
      
    }
  }
</script>

<style scoped lang="less">
  .el-form {
    padding: 0 10px;
  }

  .el-date-editor {
    width: 100% !important;
  }
</style>
